import request from 'supertest';
import { Test } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import { AppModule } from './../src/app.module';

describe('SESChannelController (e2e)', () => {
  let app: INestApplication;

  beforeAll(async () => {
    const moduleFixture = await Test.createTestingModule({
      imports: [AppModule],
    }).compile();

    app = moduleFixture.createNestApplication();
    await app.init();
  });

  it('/POST /channel/ses', () => {
    return request(app.getHttpServer())
      .post('/channel/ses')
      .send({
        subject: 'Hellworld Subject',
        to: 'yaomiao.wang@hrx.ai',
        content: 'this is then content of this email',
      })
      .expect(200);
  });
});
